rubygem-sync 

A module that provides a two-phase lock with a counter 
